package com.speedricemanager.other.application;

import android.app.Application;

import com.vondear.rxtools.RxUtils;


public class MApplication extends Application{
    //声明AMapLocationClient类对象

    public static String city,address;

    private static MApplication instances;

    public static MApplication getInstances(){
        return instances;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        instances=this;
        RxUtils.init(this);
//        LeakCanary.install(this);
//        initLocal();
    }

//    public void initLocal() {
////初始化定位
//        mLocationClient = new AMapLocationClient(getApplicationContext());
////设置定位回调监听
//        mLocationClient.setLocationListener(mAMapLocationListener);
////启动定位
//        AMapLocationClientOption mLocationOption = new AMapLocationClientOption();
//        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
//        start();
////异步获取定位结果
//    }

//    public  void start(){
//        mLocationClient.startLocation();
////    }

//    AMapLocationListener mAMapLocationListener = new AMapLocationListener(){
//        @Override
//        public void onLocationChanged(AMapLocation amapLocation) {
//            if (amapLocation != null) {
//                if (amapLocation.getErrorCode() == 0) {
//                    //解析定位结果
//                    city=amapLocation.getProvince();
//                    address=amapLocation.getAddress();
//                    mLocationClient.stopLocation();
//                }
//            }
//
//        }

//    };
}
